package com.huluobo.a2308douyindemo.adapter

import android.graphics.Paint
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.a2308douyindemo.R
import com.huluobo.a2308douyindemo.bean.GoodsBean
import com.huluobo.a2308douyindemo.utils.ImageUtils

/**
 *  Created by LC on 2025/11/4.
 */
class GoodsAdapter : BaseQuickAdapter<GoodsBean, BaseViewHolder>(R.layout.item_goods) {
    override fun convert(holder: BaseViewHolder, item: GoodsBean) {
        ImageUtils.loadRoundImage(context, item.goods_default_icon, holder.getView(R.id.item_goods_icon_iv), 20)
        holder.setText(R.id.item_goods_desc_tv, item.goods_desc)
        holder.setText(R.id.item_goods_price_tv, "${item.goods_default_price}元")
        holder.getView<TextView>(R.id.item_goods_price_tv).paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
    }
}